﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DAL;
using System.Data;
using System.Data.SqlClient;
namespace BUS
{
    public class nxbBUS : SqlDataProvider
    {
        SqlDataProvider db = new SqlDataProvider();
        public DataTable showNXB()
        {
            string sql = "showNXB";
            return db.myTable_sp(sql);
        }
        public void themNXB(string tennxb, string diachi)
        {
            string sql = "themNXB";
            SqlParameter Ptennxb = new SqlParameter("tennxb", tennxb);
            SqlParameter Pdiachi = new SqlParameter("diachi", diachi);
            db.exe_sp(sql, Ptennxb, Pdiachi);
        }
        public void xoaNXB(string manxb)
        {
            string sql = "xoaNXB";
            SqlParameter Pmanxb = new SqlParameter("manxb", manxb);
            db.exe_sp(sql, Pmanxb);
        }
        public void suaNXB(string manxb, string tennxb, string diachi)
        {
            string sql = "suaNXB";
            SqlParameter Pmanxb = new SqlParameter ("manxb",manxb);
            SqlParameter Pdiachinxb = new SqlParameter ("diachi",diachi);
            SqlParameter Ptennxb = new SqlParameter ("tennxb",tennxb);
            db.exe_sp(sql, Pmanxb, Ptennxb, Pdiachinxb);
        }
    }
}
